<?php
/* @var $this PageLocationMappingController */
/* @var $model PageLocationMapping */

$this->breadcrumbs=array(
	'Page Location Mappings'=>ApplicationConfig::getURL("", "pageLocationMapping", "admin",array('id'=>$_GET['id'])),
	'Manage',
);

$this->menu=array(
	// array('label'=>'List EpisodeDetails','url'=>array('index')),
	array('label'=>'Create Page Location','url'=>ApplicationConfig::getURL("", "pageLocationMapping", "create",array('id'=>$_GET['id']))),
	array('label'=>'Manage Pages','url'=>ApplicationConfig::getURL("", "pageMaster", "admin",array())),
);


Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#page-location-mapping-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php 
if (!empty($_GET['id']))
{
	$categoryObj = PageMaster::model()->getModel("PAGE-ID",array('page_id'=>$_GET['id']));
	$Name = $categoryObj->page_name;
}
else 
$Name = "";

?>
<h3>Manage Page  - <?php echo $Name; ?></h3>

<!-- search-form -->

<?php $this->widget('bootstrap.widgets.TbGridView', array(
	'id'=>'page-location-mapping-grid',
    'type'=>'striped bordered condensed hover',
	'dataProvider'=>$model->search($_GET['id']),
	'filter'=>$model,
	'columns'=>array(
		'mapping_id',
		array(
		'name'=>'page_id',
		'value'=>'PageMaster::model()->getModel("PAGE-ID-NAME",array("page_id"=>$data->page_id))'
		),
		'location_name',
		//'created_date',
		//'updated_date',
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
			'template' => '{update}{delete}'
		),
	),
)); ?>
